<template>
  <div class="app">
    <h3>我是App组件（祖）</h3>
    <Suspense>
      <template v-slot:default>
        <Child />
      </template>
      <template v-slot:fallback>
        <h3>稍等，加载中</h3>
      </template>
    </Suspense>
  </div>
</template>

<script>
// 静态引入
// import Child from './components/Child.vue';   

// 动态引入
import { defineAsyncComponent } from 'vue'
const Child = defineAsyncComponent(() => import("./components/Child"))

export default {
  name: 'App',
  components: {Child},
  setup() {
    
  }
}
</script>

<style>
.app {
  padding: 10px;
  background-color: gray;
}
</style>
